import { lazy } from "react";
import {createBrowserRouter} from "react-router-dom"

const Home=lazy(()=> import("../pages/Home/Home"));
const Chat=lazy(()=> import("../pages/Chat/Chat"));
const Kind=lazy(()=> import("../pages/Kind/Kind"));
const Login=lazy(()=> import("../pages/Login/Login"));
const Zhuc=lazy(()=> import("../pages/Zhuc/Zhuc"));
const City=lazy(()=> import(("../pages/City/City")));
const Tick=lazy(()=> import("../pages/Tick/Tick"));
const Detail=lazy(()=> import("../pages/Detail/Detail"));
const Error=lazy(()=> import("../pages/Error/Error"));
const Tabbar=lazy(()=> import("../pages/Tabbar/Tabbar"));
const Success=lazy(()=> import("../pages/Success/Success"));

const routes=createBrowserRouter([
    {
        path:"/",
        element:<Tabbar></Tabbar>,
        children:[
            {
                path:"/",
                element:<Home></Home>
            },
            {
                path:"/chat",
                element:<Chat></Chat>
            },
            {
                path:"/kind",
                element:<Kind></Kind>
            },
        ]
    },
    {
        path:"/login",
        element:<Login></Login>
    },
    {
        path:"/zhuc",
        element:<Zhuc></Zhuc>
    },
    {
        path:"/city",
        element:<City></City>
    },
    {
        path:"/tick",
        element:<Tick></Tick>
    },
    {
        path:"/detail:id",
        element:<Detail></Detail>
    },
    {
        path:"*",
        element:<Error></Error>
    },
    {
        path:"/success",
        element:<Success></Success>
    },
])
export default routes